<?php
/*
检查参数函数
*/

function check_param($param,$callback){
	foreach ($param as $v) {
		if (!isset($_REQUEST[$v])) {
			$msg = $v.'不存在';
			$arr = array('code' => 400, 'msg' => $msg );
			echo json_encode($arr);
			exit();
		}
	}
	$params = array();
	foreach ($param as $v) {
		$params[$v] = $_REQUEST[$v];
	}
	$callback($params);
}